Added an example of defaults as styling without all fields is still#4
Added an example of defaults as styling without all fields is still#4darbysauter wants to merge 1 commit intoavdwerff:masterfrom
Conversation
valid and is parsed by Google Maps. The example in this case is LineStyle which would not parse without ID, width, and color. I filled in the defaults with the values from https://developers.google.com/kml/documentation/kmlreference#linestyle For the ID field I fill this in with the empty string and then when the styles are looked up if the ID is null that is changed to an empty string.
|
I am not sure if setting the ID to "" is a proper fix, this works in my case but if I understand the parser correctly this will just save the last style that was received. Really a good fix would be to give these a unique ID that matches up to the Placemark. But I could not think of a clean way of doing so. Here is a snippet of the KML that I want to parse:
The KML is just a bunch of these repeated so if my understanding is correct even if it is just using the last color, that is fine for this case, but not for every case. |
valid and is parsed by Google Maps. The example in this case is
LineStyle which would not parse without ID, width, and color. I filled
in the defaults with the values from
https://developers.google.com/kml/documentation/kmlreference#linestyle
For the ID field I fill this in with the empty string and then when the
styles are looked up if the ID is null that is changed to an empty
string.